#include "Game.hpp"
#include "Exception.hpp"
#include <iostream>


int main()
{
    Game game;

    try
    {
        game.init();

        while (game.isRunning())
        {
            game.handleEvents();

            game.update();

            game.render();
        }

    }
    catch (const Exception& e)
    {
        std::cerr << e.what() << std::endl;
    }
    catch (...)
    {
        std::cerr << "An error has occured. Cleaning and exiting." << std::endl;
    }

    game.clean();

    return 0;
}
